<template>
	<router-view class="app-content" />
</template>

<style lang="scss">
	@import "./libs/styles/common.css";
	@import "./libs/styles/mulxdepota.scss";
	@import "./libs/styles/rubbishCommon.css";

	.app-container {
		position: relative;
	}

	.van-cell {
		display: flex;
		align-items: center;
		line-height: 3.4rem !important;
		font-size: 1.6rem !important;
	}

	.van-field__control {
		font-size: 1.6rem;
	}

	.fix-order-listing {
		.van-tabs__wrap {
			border-bottom: 0.5rem solid #eeeeee;
		}
	}

	.classify-fix-value input {
		text-align: right;
	}
</style>

<script>
	export default {
		created() {
			if (window.performance.navigation.type == 1) {
                let path = window.sessionStorage.getItem('RoutePath');
                if(path) this.$router.push(path);
			} else {
                this.$store.dispatch('options/checkUserIdentity', {
                    callBack: (res) => {
                        if (this.$route.path != '/login') this.$router.push('/login');
                    },
                    success: (res) => {
						// console.log(res.oda)
                        var user = res.oda;

                        // console.log('checkUserIdentity-success', user);

                        if (user.groupid == 1) {
                            this.$router.push('/shop/index');
                        } else if (user.groupid == 2) {
                            this.$router.push('/salesman/index');
                        } else if (user.groupid == 3) {
                            this.$router.push('/temporaryDirector/index');
                        } else if (user.groupid == 4) {
                            this.$router.push('/GeneralRepository/index');
                        } else if (user.groupid == 5) {
                            this.$router.push('/reservoirManagement/index');
                        } else if (user.groupid == 6) {
                            this.$router.push('/accounting/index');
                        } else if (user.groupid == 7) {
                            this.$router.push('/SuperAdmin/index');
                        }
                    }
                });
            }
		}
	}
</script>
